package com.zh.operation.service.impl;

import com.zh.common.utils.StringUtil;
import com.zh.operation.dao.BedRestDao;
import com.zh.operation.domain.BedRestDO;
import com.zh.operation.service.BedRestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;


@Service
public class BedRestServiceImpl implements BedRestService {
	@Autowired
	private BedRestDao bedRestDao;
	
	@Override
	public BedRestDO get(String id){
		return bedRestDao.get(id);
	}
	
	@Override
	public List<BedRestDO> list(Map<String, Object> map){
		return bedRestDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return bedRestDao.count(map);
	}
	
	@Override
	public int save(BedRestDO bedRest){
		bedRest.setId(StringUtil.generalKeyword());
		bedRest.setSleepTime(new Date());
		return bedRestDao.save(bedRest);
	}
	
	@Override
	public int update(BedRestDO bedRest){
		return bedRestDao.update(bedRest);
	}
	
	@Override
	public int remove(String id){
		return bedRestDao.remove(id);
	}
	
	@Override
	public int batchRemove(String[] ids){
		return bedRestDao.batchRemove(ids);
	}

	@Override
	public List<BedRestDO> list1(Map<String, Object> map) {
		return bedRestDao.list1(map);
	}

	@Override
	public int count1(Map<String, Object> map) {
		return bedRestDao.count1(map);
	}

	@Override
	public List<BedRestDO> getAll() {
		return bedRestDao.getAll();
	}

}
